import os

import launch_ros.actions
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource


def generate_launch_description():


    bringup_dir = get_package_share_directory('turn_on_bichon')
    launch_dir = os.path.join(bringup_dir, 'launch')

    bichon_robot = IncludeLaunchDescription(
            PythonLaunchDescriptionSource(os.path.join(launch_dir, 'turn_on_bichon.launch.py')),
    )
    bichon_mera = IncludeLaunchDescription(
            PythonLaunchDescriptionSource(os.path.join(bringup_dir,'launch', 'bichon_mera.launch.py')),
    )

    return LaunchDescription([
    bichon_robot,
    bichon_mera,
    launch_ros.actions.Node(
            package='aruco_ros',
            executable='single',
            parameters=[
                {'image_is_rectified': True},
                {'marker_size': 0.1},
                {'marker_id': 582},
                {'reference_frame':'camera_link'},
                {'camera_frame': 'camera_link'},
                {'marker_frame': 'aruco_marker_frame'},
                {'corner_refinement':'LINES'}
                ],
       	    remappings=[('/camera_info', '/camera/color/camera_info'),
                    ('/image', '/camera/color/image_raw')],
            output='screen',
            ),

     launch_ros.actions.Node(
            package='simple_follower_ros2',
            executable='arfollower',
            output='screen',
            ),
            ]

    )
